
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>虚拟平台运行 · book for nxos</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="nxos development team">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://book-os.org" target="_blank" class="custom-link">bookos</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" >
            
                <span>
            
                    
                    NXOS文档中心
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" >
            
                <span>
            
                    
                    简介
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1.1" data-path="../">
            
                <a href="../">
            
                    
                    NXOS 简介
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.2" >
            
                <span>
            
                    
                    快速上手
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.1.2.1" data-path="quick-start.html">
            
                <a href="quick-start.html">
            
                    
                    虚拟平台运行
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3" >
            
                <span>
            
                    
                    内核
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.1" data-path="../programing-manual/base/framework.html">
            
                <a href="../programing-manual/base/framework.html">
            
                    
                    整体框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.2" data-path="../programing-manual/base/start.html">
            
                <a href="../programing-manual/base/start.html">
            
                    
                    启动流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3" data-path="../programing-manual/mm/mm.html">
            
                <a href="../programing-manual/mm/mm.html">
            
                    
                    内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.3.1" data-path="../programing-manual/mm/buddy.html">
            
                <a href="../programing-manual/mm/buddy.html">
            
                    
                    buddy伙伴算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3.2" data-path="../programing-manual/mm/heap.html">
            
                <a href="../programing-manual/mm/heap.html">
            
                    
                    heapCache虚拟内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3.3" data-path="../programing-manual/mm/vmspace.html">
            
                <a href="../programing-manual/mm/vmspace.html">
            
                    
                    vmspace虚拟地址空间
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.4" data-path="../programing-manual/sched/sched.html">
            
                <a href="../programing-manual/sched/sched.html">
            
                    
                    调度管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.4.1" data-path="../programing-manual/sched/thread.html">
            
                <a href="../programing-manual/sched/thread.html">
            
                    
                    线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.4.2" data-path="../programing-manual/sched/smp.html">
            
                <a href="../programing-manual/sched/smp.html">
            
                    
                    SMP多核调度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.5" data-path="../programing-manual/process/process.html">
            
                <a href="../programing-manual/process/process.html">
            
                    
                    进程管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.5.1" data-path="../programing-manual/process/syscall.html">
            
                <a href="../programing-manual/process/syscall.html">
            
                    
                    系统调用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.6" data-path="../programing-manual/interrupt/irq.html">
            
                <a href="../programing-manual/interrupt/irq.html">
            
                    
                    中断系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.6.1" data-path="../programing-manual/interrupt/delay_queue.html">
            
                <a href="../programing-manual/interrupt/delay_queue.html">
            
                    
                    延迟队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.7" data-path="../programing-manual/timer/timer.html">
            
                <a href="../programing-manual/timer/timer.html">
            
                    
                    定时器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.4" >
            
                <span>
            
                    
                    内核移植
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.4.1" data-path="../programing-manual/port/riscv/riscv.html">
            
                <a href="../programing-manual/port/riscv/riscv.html">
            
                    
                    riscv架构移植
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.5" >
            
                <span>
            
                    
                    平台支持
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.5.1" data-path="../programing-manual/platform/i386.html">
            
                <a href="../programing-manual/platform/i386.html">
            
                    
                    i386
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.2" data-path="../programing-manual/platform/qemu_riscv64.html">
            
                <a href="../programing-manual/platform/qemu_riscv64.html">
            
                    
                    qemu_riscv64
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.3" data-path="../programing-manual/platform/k210.html">
            
                <a href="../programing-manual/platform/k210.html">
            
                    
                    k210
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.4" data-path="../programing-manual/platform/d1.html">
            
                <a href="../programing-manual/platform/d1.html">
            
                    
                    d1-nezha
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.5" data-path="../programing-manual/platform/hifive_unmached.html">
            
                <a href="../programing-manual/platform/hifive_unmached.html">
            
                    
                    hifive unmached
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.6" >
            
                <span>
            
                    
                    用户态服务和驱动框架
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.6.1" data-path="../programing-manual/user/userver.html">
            
                <a href="../programing-manual/user/userver.html">
            
                    
                    用户态服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6.2" data-path="../programing-manual/user/udriver.html">
            
                <a href="../programing-manual/user/udriver.html">
            
                    
                    用户态驱动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6.3" data-path="../programing-manual/user/ubpf.html">
            
                <a href="../programing-manual/user/ubpf.html">
            
                    
                    UBPF
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.7" >
            
                <span>
            
                    
                    用户接口
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.7.1" data-path="../programing-manual/user/api.html">
            
                <a href="../programing-manual/user/api.html">
            
                    
                    API设计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.8" >
            
                <span>
            
                    
                    编程开发
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.8.1" data-path="code-style.html">
            
                <a href="code-style.html">
            
                    
                    代码风格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.2" data-path="commit-rule.html">
            
                <a href="commit-rule.html">
            
                    
                    提交规则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.3" data-path="menuconfig.html">
            
                <a href="menuconfig.html">
            
                    
                    菜单配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.4" data-path="toolchains.html">
            
                <a href="toolchains.html">
            
                    
                    工具链
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.5" data-path="utest.html">
            
                <a href="utest.html">
            
                    
                    单元测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >虚拟平台运行</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5FEB;&#x901F;&#x5165;&#x95E8;">&#x5FEB;&#x901F;&#x5165;&#x95E8;</h1>
<p>&#x6B22;&#x8FCE;&#x6765;&#x5230;<code>NXOS</code>&#x5185;&#x6838;&#xFF01;<code>NXOS</code>&#x662F;&#x4E00;&#x4E2A;&#x8DE8;&#x5E73;&#x53F0;&#x7684;&#x7B80;&#x6D01;&#x7684;&#x9AD8;&#x6027;&#x80FD;&#xFF0C;&#x9AD8;&#x7A33;&#x5B9A;&#x6027;&#x7684;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x5185;&#x6838;&#xFF0C;&#x5B83;&#x5C06;&#x5E94;&#x7528;&#x4E8E;&#x684C;&#x9762;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x9886;&#x57DF;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x9886;&#x57DF;&#x4EE5;&#x53CA;&#x79FB;&#x52A8;&#x7EC8;&#x7AEF;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x9886;&#x57DF;&#x3002;</p>
<p>&#x672C;&#x6587;&#x6863;&#x5C06;&#x5E26;&#x60A8;&#x4ECE;&#x5165;&#x95E8;&#x5230;&#x529D;&#x9000;&#x3002;</p>
<h2 id="&#x4E00;&#x3001;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x642D;&#x5EFA;">&#x4E00;&#x3001;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x642D;&#x5EFA;</h2>
<h3 id="1-&#x7F16;&#x8BD1;&#x5668;&#x5DE5;&#x5177;&#x94FE;">1. &#x7F16;&#x8BD1;&#x5668;&#x5DE5;&#x5177;&#x94FE;</h3>
<p>&#x5728;&#x83B7;&#x53D6;NXOS&#x7684;&#x7CFB;&#x7EDF;&#x6E90;&#x7801;&#x540E;&#xFF0C;&#x60A8;&#x9700;&#x8981;&#x4E0B;&#x8F7D;&#x7F16;&#x8BD1;NXOS&#x7684;<a href="toolchains.html">&#x5DE5;&#x5177;&#x94FE;&#xFF08;&#x70B9;&#x6211;&#x8DF3;&#x8F6C;&#xFF09;</a>&#xFF0C;&#x4E0B;&#x8F7D;&#x597D;&#x540E;&#xFF0C;&#x8FDB;&#x884C;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x7684;&#x914D;&#x7F6E;&#x3002;</p>
<h3 id="2-&#x865A;&#x62DF;&#x673A;">2. &#x865A;&#x62DF;&#x673A;</h3>
<p>&#x6211;&#x4EEC;&#x91C7;&#x7528;&#x7684;&#x662F;&#x4E16;&#x754C;&#x4E0A;&#x6700;&#x6D41;&#x884C;&#x7684;<code>QEMU</code>&#x865A;&#x62DF;&#x673A;&#xFF0C;&#x5404;&#x79CD;&#x5E73;&#x53F0;&#x90FD;&#x6709;&#x652F;&#x6301;&#xFF0C;&#x521A;&#x597D;&#x6709;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x7684;&#x7248;&#x672C;&#x3002;</p>
<h4 id="a-windows&#x73AF;&#x5883;">a. Windows&#x73AF;&#x5883;</h4>
<p>&#x4E0B;&#x8F7D;&#x94FE;&#x63A5;&#xFF1A;<code>https://qemu.weilnetz.de/w64/</code> </p>
<p>&#x9009;&#x62E9;&#x6700;&#x65B0;&#x7248;&#x672C;&#x4E0B;&#x8F7D;&#x5373;&#x53EF;&#x3002;&#x4E0B;&#x8F7D;&#x540E;&#xFF0C;&#x5B89;&#x88C5;&#x5230;&#x4E00;&#x4E2A;&#x8DEF;&#x5F84;&#xFF0C;&#x518D;&#x628A;&#x8DEF;&#x5F84;&#x914D;&#x7F6E;&#x5230;<code>Path</code>&#x7CFB;&#x7EDF;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x4E2D;&#x5373;&#x53EF;&#x3002;</p>
<h4 id="b-linux&#x73AF;&#x5883;">b. Linux&#x73AF;&#x5883;</h4>
<p>&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x8F93;&#x5165;&#x547D;&#x4EE4;&#x5B89;&#x88C5;:</p>
<pre><code class="lang-shell"># Ubuntu/Kali Linux: 
sudo apt-get install qemu-system-i386
sudo apt-get install qemu-system-riscv64
# Red hat/Fedora/Centos: 
sudo yum install qemu-system-i386
sudo yum install qemu-system-riscv64
</code></pre>
<h3 id="3-&#x5176;&#x4ED6;&#x5DE5;&#x5177;">3. &#x5176;&#x4ED6;&#x5DE5;&#x5177;</h3>
<p>&#x5176;&#x4ED6;&#x6D89;&#x53CA;&#x5230;&#x7684;&#x5DE5;&#x5177;&#xFF1A;<code>python mtools make git genisoimage mkfs grub2</code></p>
<h4 id="a-windows&#x73AF;&#x5883;">a. Windows&#x73AF;&#x5883;</h4>
<p><a href="https://github.com/cmderdev/cmder/releases/download/v1.3.18/cmder_mini.zip" target="_blank">(cmder</a>) &#x63A8;&#x8350;&#x7684;&#x4E00;&#x4E2A;&#x4E0D;&#x9519;&#x7684;&#x7EC8;&#x7AEF;&#xFF08;&#x975E;&#x5FC5;&#x987B;&#xFF09;&#x4E0B;&#x8F7D;&#x540E;&#x5B89;&#x88C5;&#x5373;&#x53EF;&#x3002;</p>
<p><a href="ttps://www.python.org/downloads/" target="_blank">(python</a>)&#x4E0B;&#x8F7D;&#x540E;&#x5B89;&#x88C5;&#x5373;&#x53EF;&#x3002;</p>
<p><a href="https://git-scm.com/downloads" target="_blank">(git</a>)&#x4E0B;&#x8F7D;&#x540E;&#x5B89;&#x88C5;&#x5373;&#x53EF;&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x5176;&#x4ED6;&#x6BD4;&#x8F83;&#x5C0F;&#x7684;&#x5DE5;&#x5177;&#x5DF2;&#x7ECF;&#x6253;&#x5305;&#x5728;&#x4E00;&#x4E2A;&#x5DE5;&#x5177;&#x5305;&#x91CC;&#x9762;&#x4E86;&#xFF0C;&#x4E0B;&#x8F7D;&#x89E3;&#x538B;&#x540E;&#xFF0C;&#x624B;&#x52A8;&#x6DFB;&#x52A0;&#x5BF9;&#x5E94;&#x7684;&#x5DE5;&#x5177;&#x5230;&#x7CFB;&#x7EDF;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x5373;&#x53EF;&#x3002;</p>
<p><a href="http://121.43.99.128/tools/nxos/nxos-windows-tools.zip" target="_blank">nxos-windows-tools&#x670D;&#x52A1;&#x5668;&#x4E0B;&#x8F7D;&#xFF08;&#x901F;&#x5EA6;&#x8F83;&#x6162;&#xFF0C;&#x8BF7;&#x8010;&#x5FC3;&#x7B49;&#x5F85;&#xFF09;</a></p>
<p>&#x4E0B;&#x8F7D;&#x540E;&#x9700;&#x8981;&#x89E3;&#x538B;&#x51FA;&#x6765;&#xFF0C;&#x7136;&#x540E;&#x5C06;&#x6BCF;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#x914D;&#x7F6E;&#x5230;<code>Path</code>&#x7CFB;&#x7EDF;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x4E2D;&#xFF08;&#x6700;&#x597D;&#x662F;&#x914D;&#x7F6E;&#x5230;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x7684;&#x6700;&#x524D;&#x9762;&#xFF0C;&#x907F;&#x514D;&#x548C;&#x5176;&#x5B83;&#x7CFB;&#x7EDF;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#x7684;&#x5DE5;&#x5177;&#x51B2;&#x7A81;&#xFF09;&#xFF0C;&#x89E3;&#x538B;&#x540E;&#x60A8;&#x5C06;&#x4F1A;&#x6709;&#xFF1A;</p>
<pre><code>nxos-windows-tools/
nxos-windows-tools/genisoimage
nxos-windows-tools/grub-2.04
nxos-windows-tools/mkfs
nxos-windows-tools/mtools
</code></pre><h4 id="b-linux&#x73AF;&#x5883;">b. Linux&#x73AF;&#x5883;</h4>
<p>&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x8F93;&#x5165;&#x547D;&#x4EE4;&#x5B89;&#x88C5;:</p>
<pre><code class="lang-shell"># Ubuntu/Kali Linux: 
sudo apt-get install python mtools make git genisoimage mkfs grub2 truncate
# Red hat/Fedora/Centos: 
sudo yum install python mtools make git genisoimage mkfs grub2 truncate
</code></pre>
<h2 id="&#x4E8C;&#x3001;&#x7F16;&#x8BD1;&#x548C;&#x8FD0;&#x884C;">&#x4E8C;&#x3001;&#x7F16;&#x8BD1;&#x548C;&#x8FD0;&#x884C;</h2>
<p>&#x8FDB;&#x5165;&#x5230;<code>NXOS</code>&#x76EE;&#x5F55;&#x4E2D;&#xFF0C;&#x5728;&#x76EE;&#x5F55;&#x4E2D;&#x6253;&#x5F00;&#x4E00;&#x4E2A;&#x7EC8;&#x7AEF;&#x3002;</p>
<h3 id="1-&#x5FEB;&#x901F;&#x4F53;&#x9A8C;">1. &#x5FEB;&#x901F;&#x4F53;&#x9A8C;</h3>
<pre><code class="lang-shell"># 1. &#x8BBE;&#x7F6E;&#x73AF;&#x5883;&#x53D8;&#x91CF;
setup.bat # Windows&#x73AF;&#x5883;
source setup.sh # linux&#x73AF;&#x5883;

# 2. &#x914D;&#x7F6E;&#x73AF;&#x5883;&#x5E76;&#x8FD0;&#x884C;
make prepare &amp;&amp; make defconfig &amp;&amp; make run
</code></pre>
<ul>
<li>&#x8F93;&#x5165; Ctrl+a x &#x9000;&#x51FA; QEMU</li>
<li>&#x8F93;&#x5165; Ctrl+d &#x9000;&#x51FA; GDB</li>
</ul>
<h3 id="2-&#x6B65;&#x9AA4;&#x62C6;&#x89E3;">2. &#x6B65;&#x9AA4;&#x62C6;&#x89E3;</h3>
<ul>
<li>&#x8BBE;&#x7F6E;&#x4E34;&#x65F6;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#xFF0C;&#x5728;&#x76EE;&#x5F55;&#x4E2D;&#x6709;&#x811A;&#x672C;&#x6765;&#x8BBE;&#x7F6E;&#xFF0C;&#x76F4;&#x63A5;&#x8FD0;&#x884C;&#x5373;&#x53EF;&#x3002;<code>windows</code>&#x4F7F;&#x7528;<code>bat</code>&#xFF0C;<code>linux</code>&#x4F7F;&#x7528;<code>sh</code>&#x3002;</li>
</ul>
<pre><code class="lang-shell"># Windows&#x4E0B;&#x8BBE;&#x7F6E;i386&#x73AF;&#x5883;&#x5E76;&#x8BBE;&#x7F6E;PLATFORM=x86-i386
setup.bat
# Windows&#x4E0B;&#x8BBE;&#x7F6E;riscv64&#x73AF;&#x5883;PLATFORM=riscv64-qemu_riscv64
setup.bat riscv64-qemu_riscv64

# Linux&#x4E0B;&#x8BBE;&#x7F6E;i386&#x73AF;&#x5883;&#x5E76;&#x8BBE;&#x7F6E;PLATFORM=x86-i386
source setup.sh
# Linux&#x4E0B;&#x8BBE;&#x7F6E;riscv64&#x73AF;&#x5883;PLATFORM=riscv64-qemu_riscv64
source setup.sh riscv64-qemu_riscv64
</code></pre>
<ul>
<li>&#x4E3A;&#x9009;&#x4E2D;&#x7684;&#x5E73;&#x53F0;&#x505A;&#x521D;&#x59CB;&#x5316;&#xFF08;&#x4EC5;&#x4EC5;&#x7B2C;&#x4E00;&#x6B21;&#x7F16;&#x8BD1;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;&#xFF09;,&#x4F1A;&#x4E3A;&#x6BCF;&#x4E00;&#x4E2A;&#x5E73;&#x53F0;&#x4E0B;&#x8F7D;&#x5E73;&#x53F0;&#x7279;&#x522B;&#x9700;&#x8981;&#x7684;&#x5DE5;&#x5177;&#x5230;&#x5E73;&#x53F0;&#x4E2D;&#x3002;</li>
</ul>
<pre><code class="lang-shell"># &#x7B2C;&#x4E00;&#x6B21;&#x6267;&#x884C;&#x65F6;&#xFF0C;&#x4E3A;&#x5E73;&#x53F0;&#x505A;&#x521D;&#x59CB;&#x5316;
make prepare
</code></pre>
<ul>
<li>&#x52A0;&#x8F7D;&#x5E73;&#x53F0;&#x7684;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#xFF0C;&#x4F1A;&#x8BFB;&#x53D6;&#x9009;&#x4E2D;&#x7684;&#x5E73;&#x53F0;&#x7684;&#x9ED8;&#x8BA4;<code>menuconfig</code>&#x914D;&#x7F6E;&#x5230;&#x5DE5;&#x4F5C;&#x533A;&#x4E2D;&#x3002;</li>
</ul>
<pre><code class="lang-shell">make defconfig
</code></pre>
<ul>
<li>&#x4F7F;&#x7528;&#x83DC;&#x5355;&#x914D;&#x7F6E;&#x8FDB;&#x884C;&#x4E2A;&#x6027;&#x5316;&#x526A;&#x88C1;&#x3002;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x6253;&#x5F00;&#x6216;&#x8005;&#x5173;&#x95ED;&#x67D0;&#x4E9B;&#x529F;&#x80FD;&#xFF0C;&#x8BBE;&#x7F6E;&#x4E00;&#x4E9B;&#x53D8;&#x91CF;&#x7B49;&#x3002;&#x914D;&#x7F6E;&#x5B8C;&#x6210;&#x540E;&#x9700;&#x8981;&#x6309;<code>ESC</code>&#x952E;&#x9000;&#x51FA;&#xFF0C;&#x9000;&#x51FA;&#x540E;&#x4F1A;&#x751F;&#x6210;&#x65B0;&#x7684;&#x914D;&#x7F6E;&#x5934;&#x6587;&#x4EF6;&#x3002;</li>
</ul>
<pre><code class="lang-shell">make menuconfig
</code></pre>
<ul>
<li>&#x7F16;&#x8BD1;&#x6E90;&#x7801;&#x5E76;&#x8FD0;&#x884C;&#xFF0C;&#x9ED8;&#x8BA4;&#x4F7F;&#x7528;<code>QEMU</code>&#x865A;&#x62DF;&#x673A;&#x6A21;&#x62DF;&#x8FD0;&#x884C;&#xFF0C;&#x6309;&#x4E0B;&#x5C0F;&#x5199;&#x7684;<code>ctrl+x</code>&#x540E;&#x518D;&#x6309;&#x4E0B;<code>a</code>&#x5219;&#x53EF;&#x4EE5;&#x9000;&#x51FA;QEMU&#x8FD0;&#x884C;&#x3002;</li>
</ul>
<pre><code class="lang-shell"># &#x7B2C;&#x4E00;&#x6B21;&#x7F16;&#x8BD1;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5E73;&#x53F0;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;clean&#x4E00;&#x4E0B;
make clean
# &#x7F16;&#x8BD1;&#x6E90;&#x7801;&#x5E76;&#x8FD0;&#x884C;
make run
# &#x4EC5;&#x4EC5;&#x7F16;&#x8BD1;&#x6E90;&#x7801;
make
</code></pre>
<ul>
<li>&#x8C03;&#x8BD5;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x9700;&#x8981;&#x5C06;&#x914D;&#x7F6E;&#x4FE1;&#x606F;&#x548C;&#x6587;&#x4EF6;&#x4FDD;&#x5B58;&#x5230;&#x5BF9;&#x5E94;&#x5E73;&#x53F0;&#x4E2D;&#xFF0C;&#x4F7F;&#x5F97;&#x914D;&#x7F6E;&#x6C38;&#x4E45;&#x751F;&#x6548;&#x3002;</li>
</ul>
<pre><code class="lang-shell">make saveconfig
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"虚拟平台运行","level":"1.1.2.1","depth":3,"next":{"title":"内核","level":"1.1.3","depth":2,"ref":"","articles":[{"title":"整体框架","level":"1.1.3.1","depth":3,"path":"programing-manual/base/framework.md","ref":"programing-manual/base/framework.md","articles":[]},{"title":"启动流程","level":"1.1.3.2","depth":3,"path":"programing-manual/base/start.md","ref":"programing-manual/base/start.md","articles":[]},{"title":"内存管理","level":"1.1.3.3","depth":3,"path":"programing-manual/mm/mm.md","ref":"programing-manual/mm/mm.md","articles":[{"title":"buddy伙伴算法","level":"1.1.3.3.1","depth":4,"path":"programing-manual/mm/buddy.md","ref":"programing-manual/mm/buddy.md","articles":[]},{"title":"heapCache虚拟内存管理","level":"1.1.3.3.2","depth":4,"path":"programing-manual/mm/heap.md","ref":"programing-manual/mm/heap.md","articles":[]},{"title":"vmspace虚拟地址空间","level":"1.1.3.3.3","depth":4,"path":"programing-manual/mm/vmspace.md","ref":"programing-manual/mm/vmspace.md","articles":[]}]},{"title":"调度管理","level":"1.1.3.4","depth":3,"path":"programing-manual/sched/sched.md","ref":"programing-manual/sched/sched.md","articles":[{"title":"线程管理","level":"1.1.3.4.1","depth":4,"path":"programing-manual/sched/thread.md","ref":"programing-manual/sched/thread.md","articles":[]},{"title":"SMP多核调度","level":"1.1.3.4.2","depth":4,"path":"programing-manual/sched/smp.md","ref":"programing-manual/sched/smp.md","articles":[]}]},{"title":"进程管理","level":"1.1.3.5","depth":3,"path":"programing-manual/process/process.md","ref":"programing-manual/process/process.md","articles":[{"title":"系统调用","level":"1.1.3.5.1","depth":4,"path":"programing-manual/process/syscall.md","ref":"programing-manual/process/syscall.md","articles":[]}]},{"title":"中断系统","level":"1.1.3.6","depth":3,"path":"programing-manual/interrupt/irq.md","ref":"programing-manual/interrupt/irq.md","articles":[{"title":"延迟队列","level":"1.1.3.6.1","depth":4,"path":"programing-manual/interrupt/delay_queue.md","ref":"programing-manual/interrupt/delay_queue.md","articles":[]}]},{"title":"定时器","level":"1.1.3.7","depth":3,"path":"programing-manual/timer/timer.md","ref":"programing-manual/timer/timer.md","articles":[]}]},"previous":{"title":"快速上手","level":"1.1.2","depth":2,"ref":"","articles":[{"title":"虚拟平台运行","level":"1.1.2.1","depth":3,"path":"tutorial/quick-start.md","ref":"tutorial/quick-start.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy BookOS-developers 2022","modify_label":"修订时间：","modify_format":"YYYY-MM-DD"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"nxos development team","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"book for nxos","language":"zh-hans","links":{"sidebar":{"bookos":"http://book-os.org"}},"gitbook":"3.2.3","description":"document for nxos kernel"},"file":{"path":"tutorial/quick-start.md","mtime":"2022-05-03T18:23:23.524Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-05-06T18:41:01.186Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

